<template>
	<view class="page my_doctor_page">
		<patient @info="getPatientId"></patient>
		<view class="doctor_list" v-if="list.length > 0">
			<view class="card doctor_item" v-for="item in list" :key="item.getPatientId">
				<doctorInfo :item="{
					avatar:item.avatar,
					name:item.doctorName,
					titleName:item.titleName,
					departName:item.departName,
					levelName:item.levelName,
					hospitalName:item.hospitalName
				}">
				</doctorInfo>
				<view class="doctor_capacity">
					<text class="text">问诊方式:</text>
					{{item.consultationMethod == 1?'图文问诊':item.consultationMethod == 2?'语音问诊':'视频问诊' || ''}}
				</view>
				<view class="doctor_capacity ellipsis-2">
					<text class="text">病情描述:</text>
					{{item.consultationFormRespVO&&item.consultationFormRespVO.diseaseDescribe || ''}}
				</view>
				<view class="item_more">
					<view class="date">
						{{$getDate(item.createTime)}}
					</view>
					<view class="more btns"
						@click="gotoPage(`/pagesCommon/consultation/concernedDetails?id=${item.id}&consultationMethod=${item.consultationMethod}&consultationSource=${item.consultationSource}`)">
						查看详情
					</view>
				</view>
			</view>
		</view>
		<view class="no_thing" v-else>
			<image class="placeholder" src="@/static/images/noting.png" mode="scaleToFill"></image>
		</view>
	</view>
</template>

<script>
	import {
		queryPatientOutpatientInfo
	} from '@/api/index.js'
	export default {
		data() {
			return {
				list: [],
				total: 0,
				queryForm: {
					pageNo: 1,
					pageSize: 10,
				}
			}
		},
		onLoad() {
			// this.queryPatientOutpatientInfo()
		},
		methods: {
			gotoPage(url) {
				uni.navigateTo({
					url
				})
			},
			getPatientId(value) {
				this.queryForm.patientId = value.id
				this.queryPatientOutpatientInfo()
			},
			queryPatientOutpatientInfo() {
				queryPatientOutpatientInfo(this.queryForm).then(res => {
					this.list = res.data.list
				}).catch(err => {})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.my_doctor_page {
		.doctor_list {
			.doctor_item {
				margin-top: 30rpx;
				padding: 30rpx 20rpx;

				.doctor_total {
					margin-top: 30rpx;
					display: flex;
					align-items: center;
					margin-bottom: 30rpx;

					.total_item {
						position: relative;
						margin-right: 50rpx;
						font-weight: 500;
						font-size: 22rpx;
						color: rgba(153, 153, 153, 0.8);

						&:not(:last-child)::after {
							content: '';
							position: absolute;
							transform: translate(-50%, -50%);
							top: 50%;
							right: -25rpx;
							width: 1px;
							height: 80%;
							background-color: #EEEEEE;
						}

						.total {
							display: inline-block;
							margin-left: 10rpx;
							font-weight: bold;
							font-size: 26rpx;
							color: #333;
						}
					}
				}

				.doctor_capacity {
					margin-top: 20rpx;
					color: #333;
					font-size: 26rpx;

					.text {
						display: inline-block;
						color: #999999;
						margin-right: 10rpx;
					}
				}

				.item_more {
					margin-top: 20rpx;
					display: flex;
					align-items: center;
					justify-content: space-between;
					font-size: 26rpx;
					color: #999999;

					.more {
						margin: 0;
						padding: 10rpx 40rpx;
						border-radius: 10rpx;
					}
				}
			}
		}
	}
</style>